import { createRouter, createWebHashHistory } from 'vue-router';

// 导入各页面组件（先创建好对应组件文件）
import Home from '../views/Home.vue';
import DataManagement from '../views/DataManagement.vue';
import UserManagement from '../views/UserManagement.vue';
import AddManagement from '../views/AddManagement.vue';
import WarningManagement from '../views/WarningManagement.vue';
import OnlineCommunication from '../views/OnlineCommunication.vue';
import HealthGuidance from '../views/HealthGuidance.vue';
import FollowUpManagement from '../views/FollowUpManagement.vue';
import DrugRecommendation from '../views/DrugRecommendation.vue';
import PointsSystem from '../views/PointsSystem.vue';
import DataAnalysis from '../views/DataAnalysis.vue';
import DataStatistics from '../views/DataStatistics.vue';

const routes = [
    {
        path: '/Home',
        name: 'Home',
        component: Home,
    },
    {
        path: '/',
        name: 'DataManagement',
        component: DataManagement,
    },
    {
        path: '/user-management',
        name: 'UserManagement',
        component: UserManagement,
    },
    {
        path: '/add-management',
        name: 'AddManagement',
        component: AddManagement,
    },
    {
        path: '/warning-management',
        name: 'WarningManagement',
        component: WarningManagement,
    },
    {
        path: '/online-communication',
        name: 'OnlineCommunication',
        component: OnlineCommunication,
    },
    {
        path: '/health-guidance',
        name: 'HealthGuidance',
        component: HealthGuidance,
    },
    {
        path: '/follow-up-management',
        name: 'FollowUpManagement',
        component: FollowUpManagement,
    },
    {
        path: '/drug-recommendation',
        name: 'DrugRecommendation',
        component: DrugRecommendation,
    },
    {
        path: '/points-system',
        name: 'PointsSystem',
        component: PointsSystem,
    },
    {
        path: '/data-analysis',
        name: 'DataAnalysis',
        component: DataAnalysis,
    },
    {
        path: '/data-statistics',
        name: 'DataStatistics',
        component: DataStatistics,
    },
];

const router = createRouter({
    history: createWebHashHistory(), // 哈希路由（#号形式，无需后端配置）
    routes
});

export default router;